<?php
require('lib/verify.php');
require('lib/has_char.php');
require('lib/is_approved.php');

$boss_id = $_GET["id"];
$sql = "select boss_name, instance_id, instance_name 
        from wm_bosses, wm_instances
        where instance_id = boss_instance and
              boss_id='$boss_id'";
$q = $db->query($sql);
$result = $db->fetch_assoc($q);

$_category = "wardkp";
$_title = $result["instance_name"] . " / " . $result["boss_name"];
require('lib/head.php');

if($_GET["error"]!="") {
	boxRed("Error");
	echo $_GET["error"];
	boxBot();
}

boxTop("wardkp: <a href=\"loot-instance.php?id=" . $result["instance_id"] . "\">" . $result["instance_name"] ."</a> / " . $result["boss_name"]);

$sql = "select w.item_id, i.item_name
        from wm_items w
        left join item_cache i on w.item_id = i.item_id
        where w.item_boss = '$boss_id'
        order by i.item_name";
$q = $db->query($sql);
$numr = $db->num_rows($q);

echo '<a href="boss.php?id='.$boss_id.'"><b>'.$result["boss_name"].'</b></a> <i>'.$numr." items</i><br />\n".
	"Browse loot to mark items as max, mod, min or micro.<br /><br />\n".
	"<i>Mark items as max or mod; or unmark an item by selecting non.</i><br />\n";

while($item = $db->fetch_assoc($q)) {
  show_item($item, $character, $db, "$war_http/loot-boss.php?id=" . $boss_id, $system, 0);
  echo "<br/>\n";
}

boxBot();
require('lib/foot.php');
?>

